import React, { memo, useEffect, useState } from "react";
import { View } from "@tarojs/components";
import { Image } from '@antmjs/vantui'
import { useSelector } from "react-redux";




import './index.scss'

const PrivateOpinion = (props) => {
  const [resultList, setResultList] = useState([])
  const { reportDetail } = useSelector(state => state.obsPool)

  useEffect(() => {
    if (reportDetail) {
      let arr = reportDetail.otherList.filter(fund => fund.opinions)
      setResultList(arr)
    }
  }, [reportDetail])

  return (
    <View className='body-card'>
      <View className='card-name text1 black'>私募观点</View>
      {
        resultList.map(detail => {
          return (
            <View className='card-center' key={detail.id}>
              <Image fit='cover' width='64px' height='64px' src={require("@/assets/images/observation_pool_standpoint.png")}></Image>
              <View className='text3 title'>{detail.fundName}</View>
              <View className='text4'>
                {
                  detail.opinions
                }
              </View>
            </View>
          )
        })

      }

    </View>




  );
};

export default memo(PrivateOpinion);
